import Vue from 'vue'
import Router from 'vue-router'

import Home from '../components/home'
import Home1 from '../components/home1'
import login from '../components/view/login'
import regionManage from '../components/view/regionManage'
import cityManage from '../components/view/cityManage'
import positionManage from '../components/view/positionManage'
import cityDetail from '../components/view/cityDetail'
import lineParam from '../components/view/lineParam'
import lineDetail from '../components/view/lineDetail'
import rentalCompany from '../components/view/rentalCompany'
import rentalCompanyDetail from '../components/view/rentalCompanyDetail'
import userList from '../components/view/userList'
import authority from '../components/view/authority'
import passengersOrder from '../components/view/passengersOrder'
import driverOrder from '../components/view/driverOrder'
import tripOrder from '../components/view/tripOrder'

import notFound from '../components/404.vue'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/login',
    component: login,
    name: '登录'
  }, {
    path: '/',
    component: Home,
    name: '城市管理'
  }, {
    path: '/404',
    component: notFound,
    name: '页面找不到'
  }, {
    path: '/city',
    component: Home,
    name: '城市管理',
    children: [{
      path: 'home',
      component: cityManage,
      name: '城市参数'
    }, {
      path: 'region',
      component: regionManage,
      name: '区域管理'
    }, {
      path: 'position',
      component: positionManage,
      name: '定点管理'
    }, {
      path: 'detail',
      component: cityDetail,
      name: '城市详情'
    }, ]
  }, {
    path: '/line',
    component: Home,
    name: '线路管理',
    children: [{
        path: 'lineParam',
        component: lineParam,
        name: '线路参数'
      },
      {
        path: 'lineDetail',
        component: lineDetail,
        name: '线路详情'
      }
    ]
  }, {
    path: '/company',
    component: Home,
    name: '代理公司管理',
    children: [{
      path: 'rentalCompany',
      component: rentalCompany,
      name: '代理公司'
    }, {
      path: 'rentalCompanyDetail',
      component: rentalCompanyDetail,
      name: '代理公司详情'
    }]
  }, {
    path: '/sys',
    component: Home,
    name: '系统管理',
    children: [{
      path: 'userList',
      component: userList,
      name: '用户管理'
    }, {
      path: 'authority',
      component: authority,
      name: '角色管理'
    }]
  }, {
    path: '/order',
    component: Home,
    name: '订单管理',
    children: [{
      path: 'passengersOrder',
      component: passengersOrder,
      name: '乘客订单'
    }, {
      path: 'driverOrder',
      component: driverOrder,
      name: '司机订单'
    },{
      path: 'tripOrder',
      component: tripOrder,
      name: '行程管理'
    }]
  }]
})